﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace EC.Application.Interface
{
    using EC.Entity;
    using EC.Entity.Query;
    using EC.Entity.Request.Menu;
    using EC.Entity.Request.Permission;
    using EC.Entity.Request.Role;
    using EC.Entity.Request.User;
    using EC.Entity.Response.Menu;
    using EC.Entity.Response.Permission;
    using EC.Entity.Response.Role;
    using EC.Entity.Response.User;

    /// <summary>
    /// 权限接口
    /// </summary>
    public interface AuthService
    {
        #region 用户
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        UserResponse GetUser(int? id);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <returns></returns>
        JResult UpdateUserStatus(int id, int status);

        /// <summary>
        /// 是否启用google验证
        /// </summary>
        /// <returns></returns>
        JResult GoogleVerify(int id, int googleVerifyStatus);

        /// <summary>
        /// 新增、编辑
        /// </summary>
        /// <param name="request">角色</param>
        /// <param name="ids">角色编号</param>
        /// <returns></returns>
        JResult SaveUser(SaveUserRequest request, List<int> ids);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <returns></returns>
        JResult ResetPassWord(ResetPassWordRequest request);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <returns></returns>
        JResult TwoResetPassWord(ResetPassWordRequest request);

        /// <summary>
        /// 是否启用google验证
        /// </summary>
        /// <returns></returns>
        JResult MerchantGoogleVerify(int id, int googleVerifyStatus, string secretKey);
        /// <summary>
        /// 用户查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedList<UserQueryResponse> GetUserPager(UserQuery query);

        #endregion

        #region 角色
        /// <summary>
        /// 获取角色
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        RoleResponse GetRole(int id);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <returns></returns>
        JResult UpdateRoleStatus(int id, int status);

        /// <summary>
        /// 新增、编辑
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        JResult SaveRole(SaveRoleRequest request, List<SelectedAuth> selectedAuth);

        /// <summary>
        /// 获取角色菜单权限树
        /// </summary>
        /// <param name="RoleId">角色编号</param>
        /// <returns>角色菜单权限树列表</returns>
        List<ZCheckTreeNodeResponse> GetZTree(ZTreeRequest request);

        /// <summary>
        /// 角色查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedList<RoleQueryResponse> GetRolePager(RoleQuery query);
        #endregion

        #region 权限
        /// <summary>
        /// 获取权限
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        PermissionResponse GetPermission(int id);

        /// <summary>
        /// 根据菜单编号获取菜单权限
        /// </summary>
        /// <param name="menuId">菜单编号</param>
        List<PermissionResponse> GetMenuPermission(int menuId);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <returns></returns>
        JResult UpdatePermissionStatus(int id, int status);

        /// <summary>
        /// 保存、修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        JResult SavePermission(SavePermissionRequest request);

        /// <summary>
        /// 权限查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedList<PermissionResponse> GetPermissionPager(PermissionQuery query);

        /// <summary>
        /// 菜单权限查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedList<PermissionResponse> GetMenuPermissionPager(PermissionQuery query);
        #endregion

        #region 菜单
        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        MenuResponse GetMenu(int id);

        /// <summary>
        /// 更新菜单状态
        /// </summary>
        /// <returns></returns>
        JResult UpdateMenuStatus(int id, int status);

        /// <summary>
        /// 新增、编辑
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        JResult SaveMenu(SaveMenuRequest request);

        /// <summary>
        /// 菜单查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedList<MenuQueryResponse> GetMenuPager(MenuQuery query);
        #endregion
    }
}
